<?php
class editAction extends rareAction{
    public function execute(){
		$id = $this->getGetParam('id',0);
		if($id!=0){
			$dao = new DaoAlbum();
			$album = $dao->getOne("id='$id'");
			$this->assign('album',$album);
		}
	}
	public function executePost(){
		$id = $this->getPostParam('id',0);
		if($id==0) jsonReturn(0,'错误的参数');
		$album = $this->getPostParam('album',array());
		if(!empty($album)){
			$dao = new DaoAlbum();
			$dao->update("id='$id'",$album);
			jsonReturn(1,'ok');
		}
		jsonReturn(0,'错误的参数');
	}
}
?>
